Skip to content

Comments

feat: Add prometheus.createSilence and prometheus.expireSilence#3219

Merged
forestileao merged 5 commits intosuperplanehq:mainfrom
samuel-asleep:1/2-prometheus
Feb 23, 2026
Merged

feat: Add prometheus.createSilence and prometheus.expireSilence#3219
forestileao merged 5 commits intosuperplanehq:mainfrom
samuel-asleep:1/2-prometheus

Conversation

@samuel-asleep
Copy link
Contributor

@samuel-asleep samuel-asleep commented Feb 22, 2026

Implements two new Prometheus Alertmanager action components for managing silences in workflows.

Backend (pkg/integrations/prometheus/)

  • client.go: Added CreateSilence(SilencePayload) (string, error) (POST /api/v2/silences) and ExpireSilence(silenceID string) error (DELETE /api/v2/silence/{silenceID}). Refactored execRequest to delegate to new execRequestWithBody which sets Content-Type: application/json for requests with a body. Added Matcher, SilencePayload, and silenceResponse structs aligned with the Alertmanager OpenAPI spec (isRegex required, isEqual optional with default true).
  • create_silence.go: Validates matchers (non-empty, name+value required), parses duration via time.ParseDuration, computes startsAt = now / endsAt = now + duration in RFC3339, emits prometheus.silence payload, stores CreateSilenceNodeMetadata{SilenceID}.
  • expire_silence.go: Accepts silenceID (supports expressions for workflow chaining), calls ExpireSilence, emits prometheus.silence.expired payload, stores ExpireSilenceNodeMetadata{SilenceID}.
  • prometheus.go: Registered both components in Components().
  • example.go + JSON files: Added embedded example outputs for both components.

Frontend (web_src/src/pages/workflowv2/mappers/prometheus/)

  • create_silence.ts: Node metadata shows silence ID (bell-off) and matcher count; execution details show full silence info.
  • expire_silence.ts: Node metadata shows silence ID (bell); execution details show ID and status.
  • index.ts: Registered both mappers and added eventStateRegistry entries ("created", "expired").
  • types.ts: Added CreateSilenceConfiguration, ExpireSilenceConfiguration, PrometheusSilencePayload, and PrometheusMatcher interfaces.

Demo Video

2026-02-22.12-59-59.mp4

partially implements #3083 will create a second pr to complete it

samuel-asleep and others added 2 commits February 22, 2026 13:09
Signed-off-by: Akinniranye Samuel Tomiwa <benneu40@gmail.com>
Signed-off-by: Akinniranye Samuel Tomiwa <bennueu40@gmail.com>
@forestileao forestileao self-assigned this Feb 23, 2026
@forestileao
Copy link
Collaborator

@samuel-asleep The code is good and the logic looks very straightforward, I will just test on my own prometheus and we should be good :)

@samuel-asleep
Copy link
Contributor Author

@samuel-asleep The code is good and the logic looks very straightforward, I will just test on my own prometheus and we should be good :)

Thanks for the review! Sounds good 👍 Let me know if anything comes up during testing.

Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
@forestileao forestileao merged commit ce23f15 into superplanehq:main Feb 23, 2026
3 checks passed
@forestileao
Copy link
Collaborator

forestileao commented Feb 23, 2026

@samuel-asleep Just update the Silence field from the expireSilence to resourceType. And updated the UI.
Thanks for contributing with SuperPlane.

cc: @AleksandarCole

@samuel-asleep samuel-asleep deleted the 1/2-prometheus branch February 23, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants